﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Ovvio.Web.Areas.Admin.Models.ProductModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	New Product Entry
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <% using (Html.BeginForm("Create", "Products", FormMethod.Post, new { enctype = "multipart/form-data" })) {%>
        <%= Html.ValidationSummary(true) %>

        <fieldset>
        <table style="width:100%;" class="cpanel" id="tblForm" >
         <tr>
                    <td class="headerform" colspan="4">
                        <strong>New Product Entry</strong></td>
                </tr>
        <tr>
        <td>
            <div class="editor-label">
                <%= Html.LabelFor(model => model.Name) %>
            </div>
        </td>
        <td>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.Name) %>
                <%= Html.ValidationMessageFor(model => model.Name) %>
            </div>
        </td>
        <td>
            <div class="editor-label">
                <%= Html.LabelFor(model => model.PostImage)%>
            </div>
            
        </td>
            <td>
                 <div  class="editor-field">
                      <input type="file" id="PostImage" name="PostImage" />
                </div>
            </td>
        </tr>
        
        <tr >
            <td rowspan="2">
                <div class="editor-label">
                    <%= Html.LabelFor(model => model.Details) %>
                </div>
            </td> 
            <td rowspan="2">
                <div class="editor-label">
                    <%= Html.TextAreaFor(model => model.Details, 5, 40, null)%>
                    <%= Html.ValidationMessageFor(model => model.Details) %>
                </div>
            </td>
            <td>
                <div class="editor-label">
                    <%= Html.LabelFor(model => model.Price) %>
                </div>
            </td>
            <td>
                <div class="editor-field">
                    <%= Html.TextBoxFor(model => model.Price) %>
                    <%= Html.ValidationMessageFor(model => model.Price)%>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                 <div class="editor-field">
                    <%= Html.CheckBoxFor(model => model.IsOnStock) %>
                    <%= Html.LabelFor(model => model.IsOnStock) %>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="editor-label">
                 <%= Html.ActionLink("Type", "Index", "ItemTypes")%>
             </div>
            </td>
            <td>
                <div class="editor-field">
                   <%= Html.DropDownListFor(model => model.ItemTypeId, Model.ItemTypes)%>
                   <%= Html.ValidationMessageFor(model => model.ItemTypeId)%>
                </div>
            </td>
            <td>
                <div class="editor-field">
                    <%= Html.CheckBoxFor(model => model.IsPublished)%>
                    <%= Html.LabelFor(model => model.IsPublished) %>
                </div>
            </td>
        </tr>
        
        <tr>
            <td>
                <div class="editor-label">
                 <%= Html.ActionLink("Category", "Index", "Categories")%>
             </div>
            </td>
            <td>
                   <div class="editor-field">
                <%= Html.DropDownListFor(model => model.CategoryId, Model.ProductCategories)%>
                   <%= Html.ValidationMessageFor(model => model.CategoryId)%>
            </div>
            </td>
            <td>
                <div class="editor-label">
                 <%= Html.ActionLink("Discount", "Index", "Discounts")%>
             </div>
            </td>
            <td>
                   <div class="editor-field">
                    <%= Html.DropDownListFor(model => model.DiscountId, Model.Discounts)%>
                    <%= Html.ValidationMessageFor(model => model.DiscountId)%>
            </div>
            </td>
        </tr>
        <tr>
            <td>
                 <div class="editor-label">
                 <%= Html.ActionLink("Rating", "Index", "Ratings")%>
             </div>
            </td>
            <td>
                    <div class="editor-field">
                    <%= Html.DropDownListFor(model => model.RatingId, Model.Ratings)%>
                    <%= Html.ValidationMessageFor(model => model.RatingId)%>
            </div>
            </td>
            <td>
                 
            <div class="editor-label">
                 <%= Html.ActionLink("Promo", "Index", "Promos")%>
             </div>
            </td>
            <td>
                   <div class="editor-field">
                    <%= Html.DropDownListFor(model => model.PromoId, Model.Promos)%>
                    <%= Html.ValidationMessageFor(model => model.PromoId)%>
            </div>
            </td>
        </tr>
        
        </table>
            
            
            <p>
                <input type="submit" value="Create" />
            </p>
        </fieldset>
    <% } %>
       
    <div>
        <%= Html.ActionLink("Back to List", "Index") %>
    
    </div>

</asp:Content>

